﻿<Window x:Class="WpfVkontacteClient.AdditionalWindow.ModernFindWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:cont="clr-namespace:UIControls;assembly=SearchTextBox"
		Title="ModernFindWindow" Height="90" Width="250" ShowActivated="False" 
		ShowInTaskbar="False" Topmost="True" WindowStyle="None" AllowsTransparency="True" Background="Transparent">
	<Border CornerRadius="4" BorderBrush="Blue" Background="Silver">
		<Border.Resources>
			<Style TargetType="Button">
				<Setter Property="SnapsToDevicePixels" Value="True"/>
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="Button">
							<Border Name="brd" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"
									BorderBrush="Blue" BorderThickness="1" CornerRadius="4" Background="Black">
								<ContentControl HorizontalAlignment="Center" Content="{TemplateBinding Content}"
												VerticalAlignment="Center" Name="cont" Foreground="Gray">
								</ContentControl>
							</Border>
							<ControlTemplate.Triggers>
								<EventTrigger RoutedEvent="Button.MouseEnter">
									<EventTrigger.Actions>
										<BeginStoryboard>
											<Storyboard AutoReverse="True">
												<ThicknessAnimation Storyboard.TargetName="brd" Storyboard.TargetProperty="BorderThickness"
														Duration="0:0:0.8" From="1,1,1,1" To="2,2,2,2" />
												<ColorAnimation Storyboard.TargetName="brd"
																Storyboard.TargetProperty="BorderBrush.Color" To="Red" Duration="0:0:0.7"/>
											</Storyboard>
										</BeginStoryboard>
									</EventTrigger.Actions>
								</EventTrigger>
								<Trigger Property="IsPressed" Value="True">
									<Setter TargetName="brd" Property="Background" Value="LightBlue"/>
									<Setter TargetName="cont" Property="Foreground" Value="Silver"/>
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>
		</Border.Resources>
		<Grid Margin="1">
			<Grid.RowDefinitions>
				<RowDefinition Height="21"/>
				<RowDefinition/>
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition/>
				<ColumnDefinition Width="21"/>
			</Grid.ColumnDefinitions>
			<Button x:Name="btnClose" Click="btnClose_Click" Content="X" Grid.Column="1"/>
			<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Path=Title}"
						MouseLeftButtonDown="TextBlock_MouseLeftButtonDown" Foreground="Blue"/>
			<cont:SearchTextBox x:Name="srchContr" Grid.Row="1" Grid.ColumnSpan="2" Background="LightCoral" 
								Visibility="Visible" Margin="1"/>
		</Grid>
	</Border>
</Window>
